state = input().strip()
income = float(input().strip())
tax = 0.0

if state == "s":

    if income > 125000:
        tax = (income - 125000) * 0.35
        tax = (125000 - 12000) * 0.25
        tax = (12000 - 5000) * 0.15
    elif income > 12000:
        tax = (income - 12000) * 0.25
        tax = (12000 - 5000) * 0.15
    elif income > 5000:
        tax += (income - 5000) * 0.15

else:

    if income > 250000:
        tax = (income - 250000) * 0.35
        tax = (250000 - 24000) * 0.25
        tax = (24000 - 10000) * 0.15
    elif income > 24000:
        tax = (income - 24000) * 0.25
        tax = (24000 - 10000) * 0.15
    elif income > 10000:
        tax = (income - 10000) * 0.15

print(f"{tax:.2f}")


